package oa.hleast.xswl.common.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * @author 302
 * @description
 * @date 2021/3/11
 */
@NoArgsConstructor
@AllArgsConstructor
public enum ReviewStatusEnum {

    /**
     *
     */
    UN_KNOWN(0, "待审核"),
    PASS(10, "通过"),
    NO_PASS(11, "未通过");

    @Getter
    @Setter
    private Integer code;

    @Getter
    @Setter
    private String name;

    public static ReviewStatusEnum getValue(Integer code) {
        for (ReviewStatusEnum value : values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }

    public static ReviewStatusEnum getEnum(String enumName) {
        for (ReviewStatusEnum value : values()) {
            if (value.name().equals(enumName)) {
                return value;
            }
        }
        return null;
    }
}
